package com.example.common.exception;

import com.example.common.enums.GlobalExceptionEnum;
import lombok.Getter;

/**
 * <p>
 *
 * </p>
 *
 * @author 12071
 * @date 2022/8/15 14:21
 */
@Getter
public class AuthException extends RuntimeException {

    private String code;

    private String message;

    private AuthException(GlobalExceptionEnum enums) {
        this.code = enums.getCode();
        this.message = enums.getMessage();
    }

    public static AuthException build(GlobalExceptionEnum enums) {
        return new AuthException(enums);
    }
}
